package com.jingtai.platform.controller.merchants;

import com.jingtai.core.entity.merchants.MerchantsProprietaryOrder;
import com.jingtai.platform.service.merchants.MerchantsProprietaryOrderService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 商户自营订单表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/merchantsproprietaryorder")
@Api(tags = "商户自营订单表")
public class MerchantsProprietaryOrderController{

    @Autowired
    private MerchantsProprietaryOrderService merchantsProprietaryOrderService;


    @ApiOperation("商户自营订单表列表查询")
    @GetMapping("/list")
    public ResultUtil aopMerchantsProprietaryOrderList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return merchantsProprietaryOrderService.MerchantsProprietaryOrderlist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询merchantsProprietaryOrder实体")
    @GetMapping("/getMerchantsProprietaryOrderById")
    public ResultUtil GetMerchantsProprietaryOrderById(@CApiParam(name = "id",value = "merchantsProprietaryOrder实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsProprietaryOrderService.getMerchantsProprietaryOrderById(id);
    }


    @ApiOperation("新增merchantsProprietaryOrder实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"merchantsProprietaryOrder.id","merchantsProprietaryOrder.createTime","merchantsProprietaryOrder.updateTime","merchantsProprietaryOrder.deleteFlag"})
    public ResultUtil aopAddMerchantsProprietaryOrder(@RequestBody @Validated MerchantsProprietaryOrder merchantsProprietaryOrder){
        return merchantsProprietaryOrderService.addMerchantsProprietaryOrder(merchantsProprietaryOrder);
    }

    @ApiOperation("编辑merchantsProprietaryOrder实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"merchantsProprietaryOrder.createTime","merchantsProprietaryOrder.updateTime","merchantsProprietaryOrder.deleteFlag"})
    public ResultUtil aopEditMerchantsProprietaryOrder(@RequestBody @Validated MerchantsProprietaryOrder merchantsProprietaryOrder){
        return merchantsProprietaryOrderService.editMerchantsProprietaryOrder(merchantsProprietaryOrder);
    }

    @ApiOperation("根据ID删除merchantsProprietaryOrder实体")
    @GetMapping("/delMerchantsProprietaryOrderById")
    public ResultUtil aopDelMerchantsProprietaryOrderById(@CApiParam(name = "id",value = "merchantsProprietaryOrder实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return merchantsProprietaryOrderService.delMerchantsProprietaryOrderById(id);
    }

}






